import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main1(String[] args) {
        ArrayList<Integer> arrayList = new ArrayList<>();

        List<Integer> list = new ArrayList<>();

    }
    public static void main(String[] args) {
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(3);
        arrayList.add(4);
        arrayList.add(5);
        System.out.println(arrayList);

        List<Integer> list = arrayList.subList(1,4);//[1,4)
        System.out.println(list);

        list.set(2,66);
        System.out.println(list);
        System.out.println(arrayList);




    }
}
